$row = $dbw->fetchObject($res);
$onlyAuthor = $row->rev_user_text;
// Try to find a second contributor
- while( $row = $dbw->fetchObject($res) ) {
+ foreach( $res as $row ) {
if($row->rev_user_text != $onlyAuthor) {
$onlyAuthor = false;
break;
array( 'tl_namespace', 'tl_title' ),
array( 'tl_from' => $id ),
__METHOD__ );
- if ( false !== $res ) {
- if ( $dbr->numRows( $res ) ) {
- while ( $row = $dbr->fetchObject( $res ) ) {
- $result[] = Title::makeTitle( $row->tl_namespace, $row->tl_title );
- }
+ if( false !== $res ) {
+ foreach( $res as $row ) {
+ $result[] = Title::makeTitle( $row->tl_namespace, $row->tl_title );
}
}
$dbr->freeResult( $res );
'page_namespace' => NS_CATEGORY, 'page_title=cl_to'),
__METHOD__ );
if ( false !== $res ) {
- if ( $dbr->numRows( $res ) ) {
- while ( $row = $dbr->fetchObject( $res ) ) {
- $result[] = Title::makeTitle( NS_CATEGORY, $row->cl_to );
- }
+ foreach( $res as $row ) {
+ $result[] = Title::makeTitle( NS_CATEGORY, $row->cl_to );
}
}
$dbr->freeResult( $res );
global $wgContLang;
if ( false !== $res ) {
- if ( $dbr->numRows( $res ) ) {
- while ( $row = $dbr->fetchObject( $res ) ) {
- $tlTemplates[] = $wgContLang->getNsText( $row->tl_namespace ) . ':' . $row->tl_title ;
- }
+ foreach( $res as $row ) {
+ $tlTemplates[] = $wgContLang->getNsText( $row->tl_namespace ) . ':' . $row->tl_title ;
}
}
'page_id IN (' . $dbr->makeList( $ids ) . ')', __METHOD__ );
$titles = array();
- while ( $row = $dbr->fetchObject( $res ) ) {
+ foreach( $res as $row ) {
$titles[] = Title::makeTitle( $row->page_namespace, $row->page_title );
}
return $titles;
$now = wfTimestampNow();
$purgeExpired = false;
- while( $row = $dbr->fetchObject( $res ) ) {
+ foreach( $res as $row ) {
$expiry = Block::decodeExpiry( $row->pr_expiry );
if( $expiry > $now ) {
if ($get_pages) {
$now = wfTimestampNow();
$purgeExpired = false;
- while ($row = $dbr->fetchObject( $res ) ) {
+ foreach( $res as $row ) {
# Cycle through all the restrictions.
// Don't take care of restrictions types that aren't in $wgRestrictionTypes
"{$prefix}_from=page_id",
"{$prefix}_namespace" => $this->getNamespace(),
"{$prefix}_title" => $this->getDBkey() ),
- 'Title::getLinksTo',
+ __METHOD__,
$options );
$retVal = array();
if ( $db->numRows( $res ) ) {
- while ( $row = $db->fetchObject( $res ) ) {
+ foreach( $res as $row ) {
if ( $titleObj = Title::makeTitle( $row->page_namespace, $row->page_title ) ) {
$linkCache->addGoodLinkObj( $row->page_id, $titleObj, $row->page_len, $row->page_is_redirect );
$retVal[] = $titleObj;
$retVal = array();
if ( $db->numRows( $res ) ) {
- while ( $row = $db->fetchObject( $res ) ) {
+ foreach( $res as $row ) {
$retVal[] = Title::makeTitle( $row->pl_namespace, $row->pl_title );
}
}
$res = $dbr->query( $sql );
if( $dbr->numRows( $res ) > 0 ) {
- while( $x = $dbr->fetchObject( $res ) )
- //$data[] = Title::newFromText($wgContLang->getNSText ( NS_CATEGORY ).':'.$x->cl_to);
- $data[$wgContLang->getNSText( NS_CATEGORY ).':'.$x->cl_to] = $this->getFullText();
+ foreach( $res as $row )
+ //$data[] = Title::newFromText($wgContLang->getNSText ( NS_CATEGORY ).':'.$row->cl_to);
+ $data[$wgContLang->getNSText( NS_CATEGORY ).':'.$row->cl_to] = $this->getFullText();
$dbr->freeResult( $res );
} else {
$data = array();
);
if ( !is_null($ns) ) $where['page_namespace'] = $ns;
- $result = $dbr->select(
+ $res = $dbr->select(
array( 'redirect', 'page' ),
array( 'page_namespace', 'page_title' ),
$where,
);
- while( $row = $dbr->fetchObject( $result ) ) {
+ foreach( $res as $row ) {
$redirs[] = self::newFromRow( $row );
}
return $redirs;